﻿@{
    ViewBag.Title = "Index";
    Layout = "../Shared/_Layout.cshtml";
}

@using mscook.mvc;
@model IEnumerable<mscook.core.domain.ResourceType>
@Html.Partial("_DeleteModal")
<div>
    <ul class="breadcrumb">
        <li>
            <a href="#">Home</a> <span class="divider">/</span>
        </li>
        <li>
            <a href="#">Tables</a>
        </li>
    </ul>
</div>
<div class="row-fluid sortable">
    <div class="box span12">
        <div class="box-header well" data-original-title="资源类型">
            <h2>子资源类型</h2>
            <div class="box-icon">
                <a href="@Url.Action("Add", new { parentId=ViewData["parentId"]})"  class="btn btn-setting btn-round"><i class="icon-plus-sign"></i></a>
            </div>
        </div>
        <div class="box-content">
            <table class="table table-striped table-bordered bootstrap-datatable ">
                <thead>
                    <tr>
                        <th>名称</th>
                        <th>所属资源</th>
                        <th>父类型</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var ResourceType in Model)
                    {
                        <tr>
                            <td>@Html.Encode(ResourceType.Name)</td>
                            <td class="center">@Html.Encode(ResourceType.ResourceCategory)</td>
                                  <td class="center">@Html.Encode(ResourceType.ParentType==null?"":ResourceType.ParentType.Name)</td>
                            <td class="center" data-id="@ResourceType.Id">

                                <a class="btn btn-info" href="@Url.Action("Edit", new { id = @ResourceType.Id })">
                                    <i class="icon-edit icon-white"></i>
                                    Edit                                            
                                </a>
                                <a class="btn btn-danger" href="@Url.Action("Delete", new { id = @ResourceType.Id })">
                                    <i class="icon-trash icon-white"></i>
                                    Delete
                                </a>
                            </td>
                        </tr>
                    }

                </tbody>
            </table>
        </div>
    </div>
</div>
